package com.panda.mall.common.mallWares.feign;

import com.panda.mall.common.constants.ServicesName;
import com.panda.mall.common.mallWares.entity.MallGoodsCategory;
import com.panda.mall.common.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * author: tcy
 * createDate: 2023/2/3
 * description:商品三级分类feign调用
 */
@FeignClient(value = ServicesName.MALL_WARES,fallbackFactory = CategoryFallbackFactory.class)
public interface CategoryFeign {

    @ApiOperation(value = "查询商品分类", notes = "商品三级分类")
    @GetMapping("/wares/category/listCategoryTree")
    Result<List<MallGoodsCategory>> listCategoryTree();

    @ApiOperation(value = "查询三级商品", notes = "三级商品")
    @GetMapping("/wares/category/queryCategory")
    Result<List<MallGoodsCategory>> queryCategory();

    @ApiOperation(value = "按id查询商品", notes = "按id查询商品")
    @GetMapping("/wares/category/queryCategoryById/{id}")
    Result<MallGoodsCategory> queryCategoryById(@PathVariable("id") Long id);
}
